<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./layui/css/layui.css">
</head>
<body>
   
    <form class="layui-form" lay-filter="form-demo-submit"> <!-- 提示：如果你不想用form，你可以换成div等任何一个普通元素 -->
        <div class="layui-form-item">
          <label class="layui-form-label">输入框</label>
          <div class="layui-input-block">
            <input type="text" name="title" placeholder="请输入" autocomplete="off" class="layui-input">
            <input type="hidden" name="url" value="123">
          </div>
        </div>
        <div class="layui-form-item">
          <div class="layui-input-block">
    <button class="layui-btn"  lay-filter="bbsLogin" lay-submit  id="demo1">立即提交</button>
            
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
          </div>
        </div>
        
    </form>
      <script src="./layui/layui.js"></script>
      <script>
            layui.use(function(){
                var $ = layui.$;
                var form = layui.form;
                var layer = layui.layer;
                var upload = layui.upload;
                
                //执行实例
                var uploadInst = upload.render({
                    elem: '#test1' //绑定元素
                    ,url: '/upload/' //上传接口
                    ,done: function(res){
                    //上传完毕回调
                    }
                    ,error: function(){
                    //请求异常回调
                    }
                });

                //监听提交
                form.on('submit(bbsLogin)', function(data) {
                    console.log(data)
$.post("http://testapi.xuexiluxian.cn/api/member/register", {
    data:{
"mobile" : '18438632351',
"captcha" : '123456',
}
}, function(data) {
alert(JSON.stringify(data));
});
                    return false; //非常关键，否则回调不起作用
                }); 

            });
          
      </script> 

</body>
</html>